/**
 *
 * @author marc.molins.piulachs
 *
 */

package data;

public class Encrypter {
	
   static final String key = "6743C3D1519AB4F2CD9A78AB09A511BD";

   public static String encryptString(String str) {
      StringBuffer sb = new StringBuffer (str);
      int lenStr = str.length();
      int lenKey = key.length();

      for (int i = 0, j = 0; i < lenStr; i++, j++) {
         if (j >= lenKey) {
			 j = 0;
		 }  
         sb.setCharAt(i, (char)(str.charAt(i) ^ key.charAt(j)));
      }

      return sb.toString();
   }

   public static String decryptString(String str) {
      return encryptString(str);
   }
}